/**
  ******************************************************************************
  * @file    gt32f030_beep.c
  * @author  GT Application Team
  * @version V1.0.0
  * @date    03-January-2025
  *       
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; COPYRIGHT 2022 Giantec Semicondutor Inc</center></h2>
  *
  *             http://www.giantec-semi.com/
  *
  * Unless required by applicable law or agreed to in writing, software 
  * distributed under the License is distributed on an "AS IS" BASIS, 
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __GT32F030_BEEP_H
#define __GT32F030_BEEP_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "gt32f030.h"

/** @addtogroup GT32F030_StdPeriph_Driver
  * @{
  */

/** @addtogroup BEEP
  * @{
  */ 

/* Exported macro ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/

/** @defgroup BEEP_Exported_Constants
  * @{
  */
	 
#define IS_BEEP_OUTPUTDIV(DIV) ((DIV) <= 0xFFF)
	 
/** @defgroup BEEP_ClkSource 
  * @{
  */ 	 
typedef enum
{ 
  BEEP_ClkSource_LIRC = 0x01,
  BEEP_ClkSource_HXT  = 0x02,
	BEEP_ClkSource_PCLK = 0x03
}BEEPClkSource_TypeDef;
#define IS_BEEP_CLKSRC(CLKSRC) (((CLKSRC) == BEEP_ClkSource_LIRC) || \
                                ((CLKSRC) == BEEP_ClkSource_HXT) || \
                                ((CLKSRC) == BEEP_ClkSource_PCLK))
/**
  * @}
  */ 


/** @defgroup BEEP_CLKOutput_PreScale 
  * @{
  */
typedef enum
{ 
  BEEP_CLKOutput_PreScale8 = 0x00,
  BEEP_CLKOutput_PreScale4 = 0x01,
	BEEP_CLKOutput_PreScale2 = 0x02
}BEEPCLKOutputPreScale_TypeDef;
#define IS_BEEP_CLKOPRESCALE(PRESCALE) (((PRESCALE) == BEEP_CLKOutput_PreScale8) || \
                                        ((PRESCALE) == BEEP_CLKOutput_PreScale4) || \
                                        ((PRESCALE) == BEEP_CLKOutput_PreScale2))
/**
  * @}
  */ 




/**
  * @} end of  BEEP_Exported_Constants
  */

/* Exported types ------------------------------------------------------------*/
/** 
  * @brief   BEEP Init structure definition  
  */
typedef struct 
{
  BEEPClkSource_TypeDef          BEEP_ClkSource; 
  BEEPCLKOutputPreScale_TypeDef  BEEP_CLKOutputPreScale;	
	uint16_t     BEEP_OutputDiv; 
}BEEP_InitTypeDef;


/* Exported functions --------------------------------------------------------*/
void BEEP_DeInit(void);
void BEEP_Init(BEEP_InitTypeDef* BEEP_InitStruct);
void BEEP_StructInit(BEEP_InitTypeDef* BEEP_InitStruct);

void BEEP_Cmd(FunctionalState NewState);

#ifdef __cplusplus
}
#endif

#endif /* __GT32F030_BEEP_H */

/**
  * @}
  */ 

/**
  * @}
  */ 

/************************ (C) COPYRIGHT Giantec Semicondutor Inc *****END OF FILE****/
